#ifndef REGISTERWIDGET_H
#define REGISTERWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QCheckBox>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QTcpSocket>
#include <QCloseEvent>

class RegisterWidget : public QWidget
{
    Q_OBJECT

public:
    explicit RegisterWidget(QWidget *parent = nullptr);
    ~RegisterWidget();
    void closeEvent(QCloseEvent *event);

private slots:
    void onRegisterButtonClicked();
    void onconcelButtonButtonClicked();

private:
    void sendRequest(const QString &request);

    QLineEdit *userLineEdit;
    QLineEdit *passwordLineEdit;
    QPushButton *registerButton;
    QPushButton *concelButton;
    QTcpSocket *socket;               // TCP 套接字，用于与服务器通信
};

#endif // REGISTERWIDGET_H
